package com.create.builder;

import java.util.ArrayList;
import java.util.List;

/**
 * Product 产品角色
 * @author LIUZENGLONG
 *
 */
public class Room{
	
	private List<Item> items = new ArrayList<Item>();
	private String name;

	public void setName(String name){
		this.name = name;
	}

	public void createItem(Item item) {
		this.items.add(item);
	}

	public void showItems() {
		System.out.println("开始创建：" + this.name);
		float sum = 0.0F;
		for (Item item : this.items) {
			System.out.println("创建" + item.getName() + ",花费" + item.getPrice() + "元");
			sum += item.getPrice();
		}
		System.out.println("创建" + this.name + "共花费" + sum + "元");
	}
}
